/*
 * create:2016年4月24日 上午12:00:46
 * author:wangds  
 */
package com.cxkj.shop.utils;

import java.util.Collection;
import java.util.Map;

import com.cxkj.shop.model.commodity.Commodity;

/**
 * .
 * @author wangds
 *
 */
public abstract class CommoditiesUtils extends AbstractBusinessUtils{

  public static boolean createCommodity(Commodity commodity){
    return execUpdateSql("insCommodities",commodity);
  }
  
  public static boolean createCommodityMap(Map<String,Object> map){
    return execUpdateSql("insCommoditiesMap",map);
  }
  
  
  public static Commodity selCommodityById(String id){
    return execSelectOne("selCommoditiesByCommodityIdAsDefaultCommodity", id);
  }
  
  public static Commodity selCommodityByCode(String code){
    return execSelectOne("selCommoditiesByCommodityCodeAsDefaultCommodity", code);
  }
  

  public static Collection<Commodity> selAllScoreCommodities(){
    return execSelectList("selScoreAllAsDefaultCommodity", null);
  }
  
  public static Collection<Commodity> selAllCommodities(){
    return execSelectList("selCommoditiesAllAsDefaultCommodity", null);
  }
  
  protected static boolean clearCommodityById(String commodityId){
    return execUpdateSql("clearCommodityByCommodityId",commodityId);
  }
  
  public static Collection<Map<String,Object>> selHomeCommodities(){
    return execSelectList("selHomeCommoditiesOrderByCodeAsDefaultCommodity", null);
  }
  
  public static Collection<Map<String,Object>> queryCommoditiesAll(){
	    return execSelectList("queryCommoditiesAll", null);
	  }
  public static Collection<Map<String,Object>> queryIgdCmd(Map<String, Object> map){
	    return execSelectList("queryIgd_cmd",map);
	  }
  
}
